home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / util / batch / Return.readme < prev   
Text File  |  1998-03-07  |  2KB  |  85 lines

  1. Short:        Wait for return in scripts
  2. Author:       Nagilum
  3. Uploader:     nagilum@chillout.org
  4. Type:         util/cli
  5. Requires:     OS1.2
  6. Distribution: Aminet
  7.  
  8. This small command can be used in scripts to make the user press return 
  9. or enter.
  10.  
  11. Features: blinking 'Press RETURN! at the prompt', the prompt will
  12.       be clean after pressing return, no polling, easy to use.
  13.  
  14. Usage: just start it (without any parameters)
  15.  
  16. DISCLAIMER: THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE OR LOSS
  17. OF DATA OR WHATEVER CAUSED BY Return. ANYONE USES IT WITHOUT WARRANTY.
  18.  
  19. here is the source:
  20. ================================ cut here ===================================
  21.     incdir    Include:
  22.     include    dos/dos.i
  23.     include    dos/dos_lib.i
  24.     include    exec/exec_lib.i
  25.     include    exec/libraries.i
  26.     
  27.  
  28. rt        LEA    WaitStr(PC),A4
  29.         LEA    [InBuf-WaitStr](A4),A5
  30.         MOVE.L    $4.W,A6
  31.         LEA    DosName(PC),A1
  32.         MOVEQ    #0,D0
  33.         CALLLIB    OpenLibrary
  34.         TST.L    D0
  35.         BEQ.B    QUIT
  36.         MOVE.L    D0,A6
  37.         CALLLIB    Output
  38.         MOVE.L    D0,D7
  39.         BEQ.B    QUITCloseDOS
  40. WAIT        MOVE.L    D7,D1
  41.         MOVE.L    A4,D2
  42.         MOVEQ    #[InBuf-WaitStr],D3
  43.         CALLLIB    Write
  44.         MOVE.L    #1000000,D2
  45.         MOVE.L    D7,D1                ;StdOut
  46.         CALLLIB    WaitForChar
  47.         EORI.B    #1,[RVS-WaitStr](A4)
  48.         TST.L    D0
  49.         BEQ.B    WAIT
  50.         MOVE.L    D7,D1                ;StdOut
  51.         MOVE.L    A5,D2
  52.         MOVE.L    #$26,D3
  53.         CALLLIB    Write
  54.         MOVE.L    D7,D1
  55.         MOVE.L    A5,D2
  56.         MOVEQ    #$26,D3
  57.         CALLLIB    Read
  58. QUITCloseDOS    MOVE.L    A6,A1
  59.         MOVE.L    $4.W,A6
  60.         CALLLIB    CloseLibrary
  61. QUIT        MOVEQ    #0,D0
  62.         RTS
  63.  
  64. DosName    DOSNAME
  65.  
  66. WaitStr    DC.B    " ",$9B,"4"
  67. RVS    DC.B    '2m Press RETURN! '
  68.     DC.B    $9B,'0m ',$D
  69.  
  70. InBuf    DC.B    $1B,"M",13
  71.     BLK.B    $22,$20
  72.     DC.B    13
  73. end
  74. ================================ cut here ===================================
  75.  
  76.  
  77. ============================= Archive contents =============================
  78.  
  79. Original  Packed Ratio    Date     Time    Name
  80. -------- ------- ----- --------- --------  -------------
  81.      220     177 19.5% 21-Sep-97 16:57:14  Return
  82.     1613     778 51.7% 11-Feb-98 16:31:44  Return.readme
  83. -------- ------- ----- --------- --------
  84.     1833     955 47.8% 13-Feb-98 22:58:28   2 files
  85.